-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented smlua_text_utils_dialog_get #321
base: main
Are you sure you want to change the base?
Implemented smlua_text_utils_dialog_get #321
Conversation
…arguments to the dialog functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The madman picked up C and Lua did it in 2 hours,, I plan on implementing this in Character Select for replacing dialog from "Mario" to your current character.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limiting the dialog length may cause mod incompatibilities if a mod has a massive string.
I feel like it'd be best to use autogen instead of manually creating smlua_func_smlua_text_utils_dialog_get
.
This would require exposing the struct DialogEntry
, and allowing cobjects to handle strings.
@@ -40,4 +43,6 @@ void smlua_text_utils_castle_secret_stars_replace(const char* name); | |||
void smlua_text_utils_extra_text_replace(s16 index, const char* text); | |||
const char* smlua_text_utils_get_language(void); | |||
|
|||
void convert_string_sm64_to_ascii(char *strAscii, const u8 *str64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convert_string_sm64_to_ascii
does not belong to smlua_text_utils.c
it is defined in level_info.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can correct this 👍
The reason I limited dialogue length is because I had to convert the internal dialog string into a
I previously used autogen and then switched to manual in order to return a table containing all the values. I am new to Lua C and do not know how to expose a struct or allow cobjects to handle the strings being passed to Lua |
smlua_text_utils_dialog_get
as a new Lua API function.smlua_text_utils_dialog_replace
.smlua_text_utils_dialog_replace
.smlua_text_utils_dialog_replace
which displays if the provided string exceeds the hard-coded length limit of1024
.smlua_text_utils_dialog_replace
which displays if the target dialog ID is invalid (outside the range of 1-170).